#include <types.h>
#include <syscall.h>

void init_entry()
{
    int pid = fork();
    if (pid < 0) {
        prints("fork failed...", 0);
    } else if (pid == 0) {
        prints("child task...", 0);

        char *argv[] = {
            "arg0", "arg1", "arg2", "arg3"
        };
        execve("/shell.elf", argv, NULL);
    } else {
        prints("parent: child task id = %d", pid);
    }

    while (TRUE)
    {
        prints("task id = %d", getpid());
        sleep(1000);
    }
}